package com.quanxiaoha.weblog.web.controller;

import com.quanxiaoha.weblog.common.aspect.ApiOperationLog;
import com.quanxiaoha.weblog.common.utils.Response;
import com.quanxiaoha.weblog.web.model.vo.login.LoginReqVO;
import com.quanxiaoha.weblog.web.service.LoginService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "用户登录")
public class LoginController {


    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    @Operation(summary = "登录")
    @ApiOperationLog(description = "登录")
    public Response login(@RequestBody @Validated LoginReqVO loginReqVO) {
        return loginService.login(loginReqVO);
    }
}
